﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using WoChu.RfClient.Entity;

namespace WoChu.RfClient.Duty
{
    public class ProdOnShelvesUIRule
    {
        private static ProdOnShelvesUIRule _NewInstance = new ProdOnShelvesUIRule();

        public static ProdOnShelvesUIRule NewInstance
        {
            get
            {
                if (_NewInstance == null)
                {
                    _NewInstance = new ProdOnShelvesUIRule();
                }

                return _NewInstance;
            }
        }

        public List<GoodsBoxes> GetGoodsBoxesByBoxCode(string code)
        {
            try
            {
                List<GoodsBoxes> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IProdOnShelves>.NewInstance.InvokeWebMethod<List<GoodsBoxes>>("GetGoodsBoxesByBoxCode", new object[] { code });

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }

        public OutPutParams<bool> SetProdOnShelves(string userID, string locationCode, List<GoodsBoxes> lstGoodsBoxes)
        {
            try
            {
                OutPutParams<bool> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IProdOnShelves>.NewInstance.InvokeWebMethod<List<GoodsBoxes>, OutPutParams<bool>>("SetProdOnShelves", new object[] { userID, locationCode }, lstGoodsBoxes);

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }

        public GoodsInfo GetSortLoction(string goodscode)
        {
            try
            {
                return WoChu.CF.BaseFrame.WebClient.WebGetHelper<IProdOnShelves>.NewInstance.InvokeWebMethod<GoodsInfo>("GetSortLoction", new object[] { goodscode });
 
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }
    }
}
